package cn.butemecc;

import cn.bytemecc.bloomFilter.bitmap.DefaultBitmap;

import cn.bytemecc.bloomFilter.strategy.hashs.SimpleHash;
import org.junit.Test;

/**
 * @description: TODO
 * @author: Liang Zi cao
 * @DATE: 2023/7/16
 * Talk is cheap. Show me the code
 **/

public class bloomFilter {


    @Test
    public void testDefaultBitmap(){
        DefaultBitmap bitMap = new DefaultBitmap(Integer.MAX_VALUE);
        bitMap.setBit(1);
        System.out.println(bitMap.getBit(3));
    }

    @Test
    public void testSimpleHash(){
        SimpleHash simpleHash = new SimpleHash();
        DefaultBitmap bitMap = new DefaultBitmap(Integer.MAX_VALUE);
        Integer index = simpleHash.doHash("test",bitMap.getSize());

        bitMap.setBit(index);
        System.out.println(bitMap.getBit(index+1));
    }


}
